;sqrt instead of logn
#lang r5rs
(begin
  (define (aabs x)(if (< x 0)(- 0 x) x))
  (define (goodenough? x y)
    (< (aabs (- x y)) 0.00000000000000000000000000000000000000000000001))
  (define (one-newton-sqrt target answer)
    (define result (/ (+ answer (/ target answer)) 2))
    (newline)
    (display result)
    result)
  (define (newton-sqrt target answer)
    (if (goodenough? answer (one-newton-sqrt target answer))
        answer
        (newton-sqrt target (one-newton-sqrt target answer))))
  (define (asqrt x) (newton-sqrt x 1.0))
  (asqrt 5)
  )
  
